3.275 \(\int \frac {\tan ^3(c+d x) (A+B \tan (c+d x))}{(a+b \tan (c+d x))^2} \, dx\)
Optimal. Leaf size=208 \[ \frac {a (A b-a B) \tan ^2(c+d x)}{b d \left (a^2+b^2\right ) (a+b \tan (c+d x))}-\frac {\left (-2 a^2 B+a A b-b^2 B\right ) \tan (c+d x)}{b^2 d \left (a^2+b^2\right )}+\frac {\left (a^2 A+2 a b B-A b^2\right ) \log (\cos (c+d x))}{d \left (a^2+b^2\right )^2}-\frac {x \left (a^2 (-B)+2 a A b+b^2 B\right )}{\left (a^2+b^2\right )^2}+\frac {a^2 \left (-2 a^3 B+a^2 A b-4 a b^2 B+3 A b^3\right ) \log (a+b \tan (c+d x))}{b^3 d \left (a^2+b^2\right )^2} \]
[Out]
-(2*A*a*b-B*a^2+B*b^2)*x/(a^2+b^2)^2+(A*a^2-A*b^2+2*B*a*b)*ln(cos(d*x+c))/(a^2+b^2)^2/d+a^2*(A*a^2*b+3*A*b^3-2
*B*a^3-4*B*a*b^2)*ln(a+b*tan(d*x+c))/b^3/(a^2+b^2)^2/d-(A*a*b-2*B*a^2-B*b^2)*tan(d*x+c)/b^2/(a^2+b^2)/d+a*(A*b
-B*a)*tan(d*x+c)^2/b/(a^2+b^2)/d/(a+b*tan(d*x+c))
________________________________________________________________________________________
Rubi [A] time = 0.45, antiderivative size = 208, normalized size of antiderivative = 1.00,
number of steps used = 6, number of rules used = 6, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.194, Rules used =
{3605, 3647, 3626, 3617, 31, 3475} \[ \frac {a (A b-a B) \tan ^2(c+d x)}{b d \left (a^2+b^2\right ) (a+b \tan (c+d x))}-\frac {\left (-2 a^2 B+a A b-b^2 B\right ) \tan (c+d x)}{b^2 d \left (a^2+b^2\right )}+\frac {a^2 \left (a^2 A b-2 a^3 B-4 a b^2 B+3 A b^3\right ) \log (a+b \tan (c+d x))}{b^3 d \left (a^2+b^2\right )^2}+\frac {\left (a^2 A+2 a b B-A b^2\right ) \log (\cos (c+d x))}{d \left (a^2+b^2\right )^2}-\frac {x \left (a^2 (-B)+2 a A b+b^2 B\right )}{\left (a^2+b^2\right )^2} \]
Antiderivative was successfully verified.
[In]
Int[(Tan[c + d*x]^3*(A + B*Tan[c + d*x]))/(a + b*Tan[c + d*x])^2,x]
[Out]
-(((2*a*A*b - a^2*B + b^2*B)*x)/(a^2 + b^2)^2) + ((a^2*A - A*b^2 + 2*a*b*B)*Log[Cos[c + d*x]])/((a^2 + b^2)^2*
d) + (a^2*(a^2*A*b + 3*A*b^3 - 2*a^3*B - 4*a*b^2*B)*Log[a + b*Tan[c + d*x]])/(b^3*(a^2 + b^2)^2*d) - ((a*A*b -
2*a^2*B - b^2*B)*Tan[c + d*x])/(b^2*(a^2 + b^2)*d) + (a*(A*b - a*B)*Tan[c + d*x]^2)/(b*(a^2 + b^2)*d*(a + b*T
an[c + d*x]))
Rule 31
Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]
Rule 3475
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]
Rule 3605
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e
_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[((b*c - a*d)*(B*c - A*d)*(a + b*Tan[e + f*x])^(m - 1)*(c + d*Tan[e
+ f*x])^(n + 1))/(d*f*(n + 1)*(c^2 + d^2)), x] - Dist[1/(d*(n + 1)*(c^2 + d^2)), Int[(a + b*Tan[e + f*x])^(m -
2)*(c + d*Tan[e + f*x])^(n + 1)*Simp[a*A*d*(b*d*(m - 1) - a*c*(n + 1)) + (b*B*c - (A*b + a*B)*d)*(b*c*(m - 1)
+ a*d*(n + 1)) - d*((a*A - b*B)*(b*c - a*d) + (A*b + a*B)*(a*c + b*d))*(n + 1)*Tan[e + f*x] - b*(d*(A*b*c + a
*B*c - a*A*d)*(m + n) - b*B*(c^2*(m - 1) - d^2*(n + 1)))*Tan[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f
, A, B}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && GtQ[m, 1] && LtQ[n, -1] && (Inte
gerQ[m] || IntegersQ[2*m, 2*n])
Rule 3617
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Dist[
A/(b*f), Subst[Int[(a + x)^m, x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, A, C, m}, x] && EqQ[A, C]
Rule 3626
Int[((A_) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2)/((a_.) + (b_.)*tan[(e_.) + (f_.)*
(x_)]), x_Symbol] :> Simp[((a*A + b*B - a*C)*x)/(a^2 + b^2), x] + (Dist[(A*b^2 - a*b*B + a^2*C)/(a^2 + b^2), I
nt[(1 + Tan[e + f*x]^2)/(a + b*Tan[e + f*x]), x], x] - Dist[(A*b - a*B - b*C)/(a^2 + b^2), Int[Tan[e + f*x], x
], x]) /; FreeQ[{a, b, e, f, A, B, C}, x] && NeQ[A*b^2 - a*b*B + a^2*C, 0] && NeQ[a^2 + b^2, 0] && NeQ[A*b - a
*B - b*C, 0]
Rule 3647
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_)*((A_.) + (B_.)*
tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(C*(a + b*Tan[e + f*x])^m*(c + d
*Tan[e + f*x])^(n + 1))/(d*f*(m + n + 1)), x] + Dist[1/(d*(m + n + 1)), Int[(a + b*Tan[e + f*x])^(m - 1)*(c +
d*Tan[e + f*x])^n*Simp[a*A*d*(m + n + 1) - C*(b*c*m + a*d*(n + 1)) + d*(A*b + a*B - b*C)*(m + n + 1)*Tan[e + f
*x] - (C*m*(b*c - a*d) - b*B*d*(m + n + 1))*Tan[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C, n}
, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && GtQ[m, 0] && !(IGtQ[n, 0] && ( !Intege
rQ[m] || (EqQ[c, 0] && NeQ[a, 0])))
Rubi steps
\begin {align*} \int \frac {\tan ^3(c+d x) (A+B \tan (c+d x))}{(a+b \tan (c+d x))^2} \, dx &=\frac {a (A b-a B) \tan ^2(c+d x)}{b \left (a^2+b^2\right ) d (a+b \tan (c+d x))}+\frac {\int \frac {\tan (c+d x) \left (-2 a (A b-a B)+b (A b-a B) \tan (c+d x)-\left (a A b-2 a^2 B-b^2 B\right ) \tan ^2(c+d x)\right )}{a+b \tan (c+d x)} \, dx}{b \left (a^2+b^2\right )}\\ &=-\frac {\left (a A b-2 a^2 B-b^2 B\right ) \tan (c+d x)}{b^2 \left (a^2+b^2\right ) d}+\frac {a (A b-a B) \tan ^2(c+d x)}{b \left (a^2+b^2\right ) d (a+b \tan (c+d x))}+\frac {\int \frac {a \left (a A b-2 a^2 B-b^2 B\right )-b^2 (a A+b B) \tan (c+d x)+\left (a^2+b^2\right ) (A b-2 a B) \tan ^2(c+d x)}{a+b \tan (c+d x)} \, dx}{b^2 \left (a^2+b^2\right )}\\ &=-\frac {\left (2 a A b-a^2 B+b^2 B\right ) x}{\left (a^2+b^2\right )^2}-\frac {\left (a A b-2 a^2 B-b^2 B\right ) \tan (c+d x)}{b^2 \left (a^2+b^2\right ) d}+\frac {a (A b-a B) \tan ^2(c+d x)}{b \left (a^2+b^2\right ) d (a+b \tan (c+d x))}-\frac {\left (a^2 A-A b^2+2 a b B\right ) \int \tan (c+d x) \, dx}{\left (a^2+b^2\right )^2}+\frac {\left (a^2 \left (a^2 A b+3 A b^3-2 a^3 B-4 a b^2 B\right )\right ) \int \frac {1+\tan ^2(c+d x)}{a+b \tan (c+d x)} \, dx}{b^2 \left (a^2+b^2\right )^2}\\ &=-\frac {\left (2 a A b-a^2 B+b^2 B\right ) x}{\left (a^2+b^2\right )^2}+\frac {\left (a^2 A-A b^2+2 a b B\right ) \log (\cos (c+d x))}{\left (a^2+b^2\right )^2 d}-\frac {\left (a A b-2 a^2 B-b^2 B\right ) \tan (c+d x)}{b^2 \left (a^2+b^2\right ) d}+\frac {a (A b-a B) \tan ^2(c+d x)}{b \left (a^2+b^2\right ) d (a+b \tan (c+d x))}+\frac {\left (a^2 \left (a^2 A b+3 A b^3-2 a^3 B-4 a b^2 B\right )\right ) \operatorname {Subst}\left (\int \frac {1}{a+x} \, dx,x,b \tan (c+d x)\right )}{b^3 \left (a^2+b^2\right )^2 d}\\ &=-\frac {\left (2 a A b-a^2 B+b^2 B\right ) x}{\left (a^2+b^2\right )^2}+\frac {\left (a^2 A-A b^2+2 a b B\right ) \log (\cos (c+d x))}{\left (a^2+b^2\right )^2 d}+\frac {a^2 \left (a^2 A b+3 A b^3-2 a^3 B-4 a b^2 B\right ) \log (a+b \tan (c+d x))}{b^3 \left (a^2+b^2\right )^2 d}-\frac {\left (a A b-2 a^2 B-b^2 B\right ) \tan (c+d x)}{b^2 \left (a^2+b^2\right ) d}+\frac {a (A b-a B) \tan ^2(c+d x)}{b \left (a^2+b^2\right ) d (a+b \tan (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 4.16, size = 444, normalized size = 2.13 \[ \frac {2 b^2 B \left (a^2+b^2\right )^2 \tan ^2(c+d x)+2 i a^2 \left (2 a^3 B-a^2 A b+4 a b^2 B-3 A b^3\right ) \tan ^{-1}(\tan (c+d x)) (a+b \tan (c+d x))+a \left (2 \left (a^2+b^2\right )^2 (2 a B-A b) \log (\cos (c+d x))+2 (a+i b)^2 (c+d x) \left (-2 i a^3 B+i a^2 b (A+4 i B)+2 a b^2 (A+i B)+b^3 B\right )+a^2 \left (-2 a^3 B+a^2 A b-4 a b^2 B+3 A b^3\right ) \log \left ((a \cos (c+d x)+b \sin (c+d x))^2\right )\right )+b \tan (c+d x) \left (2 \left (a^2+b^2\right )^2 (2 a B-A b) \log (\cos (c+d x))+a^2 \left (-2 a^3 B+a^2 A b-4 a b^2 B+3 A b^3\right ) \log \left ((a \cos (c+d x)+b \sin (c+d x))^2\right )+2 \left (-2 i a^5 B (c+d x+i)+i a^4 A b (c+d x+i)+a^3 b^2 B (-4 i c-4 i d x+3)+a^2 b^3 (B (c+d x)+i A (3 c+3 d x+i))+a b^4 (B-2 A (c+d x))-b^5 B (c+d x)\right )\right )}{2 b^3 d \left (a^2+b^2\right )^2 (a+b \tan (c+d x))} \]
Antiderivative was successfully verified.
[In]
Integrate[(Tan[c + d*x]^3*(A + B*Tan[c + d*x]))/(a + b*Tan[c + d*x])^2,x]
[Out]
(a*(2*(a + I*b)^2*(2*a*b^2*(A + I*B) + I*a^2*b*(A + (4*I)*B) - (2*I)*a^3*B + b^3*B)*(c + d*x) + 2*(a^2 + b^2)^
2*(-(A*b) + 2*a*B)*Log[Cos[c + d*x]] + a^2*(a^2*A*b + 3*A*b^3 - 2*a^3*B - 4*a*b^2*B)*Log[(a*Cos[c + d*x] + b*S
in[c + d*x])^2]) + b*(2*(a^3*b^2*B*(3 - (4*I)*c - (4*I)*d*x) - b^5*B*(c + d*x) + I*a^4*A*b*(I + c + d*x) - (2*
I)*a^5*B*(I + c + d*x) + a*b^4*(B - 2*A*(c + d*x)) + a^2*b^3*(B*(c + d*x) + I*A*(I + 3*c + 3*d*x))) + 2*(a^2 +
b^2)^2*(-(A*b) + 2*a*B)*Log[Cos[c + d*x]] + a^2*(a^2*A*b + 3*A*b^3 - 2*a^3*B - 4*a*b^2*B)*Log[(a*Cos[c + d*x]
+ b*Sin[c + d*x])^2])*Tan[c + d*x] + 2*b^2*(a^2 + b^2)^2*B*Tan[c + d*x]^2 + (2*I)*a^2*(-(a^2*A*b) - 3*A*b^3 +
2*a^3*B + 4*a*b^2*B)*ArcTan[Tan[c + d*x]]*(a + b*Tan[c + d*x]))/(2*b^3*(a^2 + b^2)^2*d*(a + b*Tan[c + d*x]))
________________________________________________________________________________________
fricas [B] time = 0.80, size = 434, normalized size = 2.09 \[ -\frac {2 \, B a^{4} b^{2} - 2 \, A a^{3} b^{3} - 2 \, {\left (B a^{3} b^{3} - 2 \, A a^{2} b^{4} - B a b^{5}\right )} d x - 2 \, {\left (B a^{4} b^{2} + 2 \, B a^{2} b^{4} + B b^{6}\right )} \tan \left (d x + c\right )^{2} + {\left (2 \, B a^{6} - A a^{5} b + 4 \, B a^{4} b^{2} - 3 \, A a^{3} b^{3} + {\left (2 \, B a^{5} b - A a^{4} b^{2} + 4 \, B a^{3} b^{3} - 3 \, A a^{2} b^{4}\right )} \tan \left (d x + c\right )\right )} \log \left (\frac {b^{2} \tan \left (d x + c\right )^{2} + 2 \, a b \tan \left (d x + c\right ) + a^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) - {\left (2 \, B a^{6} - A a^{5} b + 4 \, B a^{4} b^{2} - 2 \, A a^{3} b^{3} + 2 \, B a^{2} b^{4} - A a b^{5} + {\left (2 \, B a^{5} b - A a^{4} b^{2} + 4 \, B a^{3} b^{3} - 2 \, A a^{2} b^{4} + 2 \, B a b^{5} - A b^{6}\right )} \tan \left (d x + c\right )\right )} \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right ) - 2 \, {\left (2 \, B a^{5} b - A a^{4} b^{2} + 2 \, B a^{3} b^{3} + B a b^{5} + {\left (B a^{2} b^{4} - 2 \, A a b^{5} - B b^{6}\right )} d x\right )} \tan \left (d x + c\right )}{2 \, {\left ({\left (a^{4} b^{4} + 2 \, a^{2} b^{6} + b^{8}\right )} d \tan \left (d x + c\right ) + {\left (a^{5} b^{3} + 2 \, a^{3} b^{5} + a b^{7}\right )} d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate(tan(d*x+c)^3*(A+B*tan(d*x+c))/(a+b*tan(d*x+c))^2,x, algorithm="fricas")
[Out]
-1/2*(2*B*a^4*b^2 - 2*A*a^3*b^3 - 2*(B*a^3*b^3 - 2*A*a^2*b^4 - B*a*b^5)*d*x - 2*(B*a^4*b^2 + 2*B*a^2*b^4 + B*b
^6)*tan(d*x + c)^2 + (2*B*a^6 - A*a^5*b + 4*B*a^4*b^2 - 3*A*a^3*b^3 + (2*B*a^5*b - A*a^4*b^2 + 4*B*a^3*b^3 - 3
*A*a^2*b^4)*tan(d*x + c))*log((b^2*tan(d*x + c)^2 + 2*a*b*tan(d*x + c) + a^2)/(tan(d*x + c)^2 + 1)) - (2*B*a^6
- A*a^5*b + 4*B*a^4*b^2 - 2*A*a^3*b^3 + 2*B*a^2*b^4 - A*a*b^5 + (2*B*a^5*b - A*a^4*b^2 + 4*B*a^3*b^3 - 2*A*a^
2*b^4 + 2*B*a*b^5 - A*b^6)*tan(d*x + c))*log(1/(tan(d*x + c)^2 + 1)) - 2*(2*B*a^5*b - A*a^4*b^2 + 2*B*a^3*b^3
+ B*a*b^5 + (B*a^2*b^4 - 2*A*a*b^5 - B*b^6)*d*x)*tan(d*x + c))/((a^4*b^4 + 2*a^2*b^6 + b^8)*d*tan(d*x + c) + (
a^5*b^3 + 2*a^3*b^5 + a*b^7)*d)
________________________________________________________________________________________
giac [A] time = 1.03, size = 290, normalized size = 1.39 \[ \frac {\frac {2 \, {\left (B a^{2} - 2 \, A a b - B b^{2}\right )} {\left (d x + c\right )}}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} - \frac {{\left (A a^{2} + 2 \, B a b - A b^{2}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} - \frac {2 \, {\left (2 \, B a^{5} - A a^{4} b + 4 \, B a^{3} b^{2} - 3 \, A a^{2} b^{3}\right )} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{a^{4} b^{3} + 2 \, a^{2} b^{5} + b^{7}} + \frac {2 \, B \tan \left (d x + c\right )}{b^{2}} + \frac {2 \, {\left (2 \, B a^{5} b \tan \left (d x + c\right ) - A a^{4} b^{2} \tan \left (d x + c\right ) + 4 \, B a^{3} b^{3} \tan \left (d x + c\right ) - 3 \, A a^{2} b^{4} \tan \left (d x + c\right ) + B a^{6} + 3 \, B a^{4} b^{2} - 2 \, A a^{3} b^{3}\right )}}{{\left (a^{4} b^{3} + 2 \, a^{2} b^{5} + b^{7}\right )} {\left (b \tan \left (d x + c\right ) + a\right )}}}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate(tan(d*x+c)^3*(A+B*tan(d*x+c))/(a+b*tan(d*x+c))^2,x, algorithm="giac")
[Out]
1/2*(2*(B*a^2 - 2*A*a*b - B*b^2)*(d*x + c)/(a^4 + 2*a^2*b^2 + b^4) - (A*a^2 + 2*B*a*b - A*b^2)*log(tan(d*x + c
)^2 + 1)/(a^4 + 2*a^2*b^2 + b^4) - 2*(2*B*a^5 - A*a^4*b + 4*B*a^3*b^2 - 3*A*a^2*b^3)*log(abs(b*tan(d*x + c) +
a))/(a^4*b^3 + 2*a^2*b^5 + b^7) + 2*B*tan(d*x + c)/b^2 + 2*(2*B*a^5*b*tan(d*x + c) - A*a^4*b^2*tan(d*x + c) +
4*B*a^3*b^3*tan(d*x + c) - 3*A*a^2*b^4*tan(d*x + c) + B*a^6 + 3*B*a^4*b^2 - 2*A*a^3*b^3)/((a^4*b^3 + 2*a^2*b^5
+ b^7)*(b*tan(d*x + c) + a)))/d
________________________________________________________________________________________
maple [A] time = 0.22, size = 364, normalized size = 1.75 \[ \frac {B \tan \left (d x +c \right )}{d \,b^{2}}+\frac {a^{4} \ln \left (a +b \tan \left (d x +c \right )\right ) A}{d \,b^{2} \left (a^{2}+b^{2}\right )^{2}}+\frac {3 a^{2} \ln \left (a +b \tan \left (d x +c \right )\right ) A}{d \left (a^{2}+b^{2}\right )^{2}}-\frac {2 a^{5} \ln \left (a +b \tan \left (d x +c \right )\right ) B}{d \,b^{3} \left (a^{2}+b^{2}\right )^{2}}-\frac {4 a^{3} \ln \left (a +b \tan \left (d x +c \right )\right ) B}{d b \left (a^{2}+b^{2}\right )^{2}}+\frac {a^{3} A}{d \,b^{2} \left (a^{2}+b^{2}\right ) \left (a +b \tan \left (d x +c \right )\right )}-\frac {a^{4} B}{d \,b^{3} \left (a^{2}+b^{2}\right ) \left (a +b \tan \left (d x +c \right )\right )}-\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right ) a^{2} A}{2 d \left (a^{2}+b^{2}\right )^{2}}+\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right ) A \,b^{2}}{2 d \left (a^{2}+b^{2}\right )^{2}}-\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right ) B a b}{d \left (a^{2}+b^{2}\right )^{2}}-\frac {2 A \arctan \left (\tan \left (d x +c \right )\right ) a b}{d \left (a^{2}+b^{2}\right )^{2}}+\frac {B \arctan \left (\tan \left (d x +c \right )\right ) a^{2}}{d \left (a^{2}+b^{2}\right )^{2}}-\frac {B \arctan \left (\tan \left (d x +c \right )\right ) b^{2}}{d \left (a^{2}+b^{2}\right )^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
int(tan(d*x+c)^3*(A+B*tan(d*x+c))/(a+b*tan(d*x+c))^2,x)
[Out]
1/d*B/b^2*tan(d*x+c)+1/d/b^2*a^4/(a^2+b^2)^2*ln(a+b*tan(d*x+c))*A+3/d*a^2/(a^2+b^2)^2*ln(a+b*tan(d*x+c))*A-2/d
/b^3*a^5/(a^2+b^2)^2*ln(a+b*tan(d*x+c))*B-4/d/b*a^3/(a^2+b^2)^2*ln(a+b*tan(d*x+c))*B+1/d/b^2*a^3/(a^2+b^2)/(a+
b*tan(d*x+c))*A-1/d/b^3*a^4/(a^2+b^2)/(a+b*tan(d*x+c))*B-1/2/d/(a^2+b^2)^2*ln(1+tan(d*x+c)^2)*a^2*A+1/2/d/(a^2
+b^2)^2*ln(1+tan(d*x+c)^2)*A*b^2-1/d/(a^2+b^2)^2*ln(1+tan(d*x+c)^2)*B*a*b-2/d/(a^2+b^2)^2*A*arctan(tan(d*x+c))
*a*b+1/d/(a^2+b^2)^2*B*arctan(tan(d*x+c))*a^2-1/d/(a^2+b^2)^2*B*arctan(tan(d*x+c))*b^2
________________________________________________________________________________________
maxima [A] time = 0.88, size = 220, normalized size = 1.06 \[ \frac {\frac {2 \, {\left (B a^{2} - 2 \, A a b - B b^{2}\right )} {\left (d x + c\right )}}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} - \frac {2 \, {\left (2 \, B a^{5} - A a^{4} b + 4 \, B a^{3} b^{2} - 3 \, A a^{2} b^{3}\right )} \log \left (b \tan \left (d x + c\right ) + a\right )}{a^{4} b^{3} + 2 \, a^{2} b^{5} + b^{7}} - \frac {{\left (A a^{2} + 2 \, B a b - A b^{2}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right )}{a^{4} + 2 \, a^{2} b^{2} + b^{4}} - \frac {2 \, {\left (B a^{4} - A a^{3} b\right )}}{a^{3} b^{3} + a b^{5} + {\left (a^{2} b^{4} + b^{6}\right )} \tan \left (d x + c\right )} + \frac {2 \, B \tan \left (d x + c\right )}{b^{2}}}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate(tan(d*x+c)^3*(A+B*tan(d*x+c))/(a+b*tan(d*x+c))^2,x, algorithm="maxima")
[Out]
1/2*(2*(B*a^2 - 2*A*a*b - B*b^2)*(d*x + c)/(a^4 + 2*a^2*b^2 + b^4) - 2*(2*B*a^5 - A*a^4*b + 4*B*a^3*b^2 - 3*A*
a^2*b^3)*log(b*tan(d*x + c) + a)/(a^4*b^3 + 2*a^2*b^5 + b^7) - (A*a^2 + 2*B*a*b - A*b^2)*log(tan(d*x + c)^2 +
1)/(a^4 + 2*a^2*b^2 + b^4) - 2*(B*a^4 - A*a^3*b)/(a^3*b^3 + a*b^5 + (a^2*b^4 + b^6)*tan(d*x + c)) + 2*B*tan(d*
x + c)/b^2)/d
________________________________________________________________________________________
mupad [B] time = 7.19, size = 210, normalized size = 1.01 \[ \frac {B\,\mathrm {tan}\left (c+d\,x\right )}{b^2\,d}-\frac {\ln \left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )\,\left (2\,B\,a^5-A\,a^4\,b+4\,B\,a^3\,b^2-3\,A\,a^2\,b^3\right )}{d\,\left (a^4\,b^3+2\,a^2\,b^5+b^7\right )}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,\left (A+B\,1{}\mathrm {i}\right )}{2\,d\,\left (a^2+a\,b\,2{}\mathrm {i}-b^2\right )}-\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (B+A\,1{}\mathrm {i}\right )}{2\,d\,\left (a^2\,1{}\mathrm {i}+2\,a\,b-b^2\,1{}\mathrm {i}\right )}-\frac {a^2\,\left (B\,a^2-A\,a\,b\right )}{b\,d\,\left (\mathrm {tan}\left (c+d\,x\right )\,b^3+a\,b^2\right )\,\left (a^2+b^2\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
int((tan(c + d*x)^3*(A + B*tan(c + d*x)))/(a + b*tan(c + d*x))^2,x)
[Out]
(B*tan(c + d*x))/(b^2*d) - (log(a + b*tan(c + d*x))*(2*B*a^5 - 3*A*a^2*b^3 + 4*B*a^3*b^2 - A*a^4*b))/(d*(b^7 +
2*a^2*b^5 + a^4*b^3)) - (log(tan(c + d*x) - 1i)*(A + B*1i))/(2*d*(a*b*2i + a^2 - b^2)) - (log(tan(c + d*x) +
1i)*(A*1i + B))/(2*d*(2*a*b + a^2*1i - b^2*1i)) - (a^2*(B*a^2 - A*a*b))/(b*d*(a*b^2 + b^3*tan(c + d*x))*(a^2 +
b^2))
________________________________________________________________________________________
sympy [A] time = 3.01, size = 4595, normalized size = 22.09 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate(tan(d*x+c)**3*(A+B*tan(d*x+c))/(a+b*tan(d*x+c))**2,x)
[Out]
Piecewise((zoo*x*(A + B*tan(c))*tan(c), Eq(a, 0) & Eq(b, 0) & Eq(d, 0)), ((-A*log(tan(c + d*x)**2 + 1)/(2*d) +
A*tan(c + d*x)**2/(2*d) + B*x + B*tan(c + d*x)**3/(3*d) - B*tan(c + d*x)/d)/a**2, Eq(b, 0)), (-3*A*d*x*tan(c
+ d*x)**2/(4*I*b**2*d*tan(c + d*x)**2 + 8*b**2*d*tan(c + d*x) - 4*I*b**2*d) + 6*I*A*d*x*tan(c + d*x)/(4*I*b**2
*d*tan(c + d*x)**2 + 8*b**2*d*tan(c + d*x) - 4*I*b**2*d) + 3*A*d*x/(4*I*b**2*d*tan(c + d*x)**2 + 8*b**2*d*tan(
c + d*x) - 4*I*b**2*d) + 2*I*A*log(tan(c + d*x)**2 + 1)*tan(c + d*x)**2/(4*I*b**2*d*tan(c + d*x)**2 + 8*b**2*d
*tan(c + d*x) - 4*I*b**2*d) + 4*A*log(tan(c + d*x)**2 + 1)*tan(c + d*x)/(4*I*b**2*d*tan(c + d*x)**2 + 8*b**2*d
*tan(c + d*x) - 4*I*b**2*d) - 2*I*A*log(tan(c + d*x)**2 + 1)/(4*I*b**2*d*tan(c + d*x)**2 + 8*b**2*d*tan(c + d*
x) - 4*I*b**2*d) + 5*A*tan(c + d*x)/(4*I*b**2*d*tan(c + d*x)**2 + 8*b**2*d*tan(c + d*x) - 4*I*b**2*d) - 4*I*A/
(4*I*b**2*d*tan(c + d*x)**2 + 8*b**2*d*tan(c + d*x) - 4*I*b**2*d) - 9*I*B*d*x*tan(c + d*x)**2/(4*I*b**2*d*tan(
c + d*x)**2 + 8*b**2*d*tan(c + d*x) - 4*I*b**2*d) - 18*B*d*x*tan(c + d*x)/(4*I*b**2*d*tan(c + d*x)**2 + 8*b**2
*d*tan(c + d*x) - 4*I*b**2*d) + 9*I*B*d*x/(4*I*b**2*d*tan(c + d*x)**2 + 8*b**2*d*tan(c + d*x) - 4*I*b**2*d) -
4*B*log(tan(c + d*x)**2 + 1)*tan(c + d*x)**2/(4*I*b**2*d*tan(c + d*x)**2 + 8*b**2*d*tan(c + d*x) - 4*I*b**2*d)
+ 8*I*B*log(tan(c + d*x)**2 + 1)*tan(c + d*x)/(4*I*b**2*d*tan(c + d*x)**2 + 8*b**2*d*tan(c + d*x) - 4*I*b**2*
d) + 4*B*log(tan(c + d*x)**2 + 1)/(4*I*b**2*d*tan(c + d*x)**2 + 8*b**2*d*tan(c + d*x) - 4*I*b**2*d) + 4*I*B*ta
n(c + d*x)**3/(4*I*b**2*d*tan(c + d*x)**2 + 8*b**2*d*tan(c + d*x) - 4*I*b**2*d) + 19*I*B*tan(c + d*x)/(4*I*b**
2*d*tan(c + d*x)**2 + 8*b**2*d*tan(c + d*x) - 4*I*b**2*d) + 14*B/(4*I*b**2*d*tan(c + d*x)**2 + 8*b**2*d*tan(c
+ d*x) - 4*I*b**2*d), Eq(a, -I*b)), (-3*A*d*x*tan(c + d*x)**2/(-4*I*b**2*d*tan(c + d*x)**2 + 8*b**2*d*tan(c +
d*x) + 4*I*b**2*d) - 6*I*A*d*x*tan(c + d*x)/(-4*I*b**2*d*tan(c + d*x)**2 + 8*b**2*d*tan(c + d*x) + 4*I*b**2*d)
+ 3*A*d*x/(-4*I*b**2*d*tan(c + d*x)**2 + 8*b**2*d*tan(c + d*x) + 4*I*b**2*d) - 2*I*A*log(tan(c + d*x)**2 + 1)
*tan(c + d*x)**2/(-4*I*b**2*d*tan(c + d*x)**2 + 8*b**2*d*tan(c + d*x) + 4*I*b**2*d) + 4*A*log(tan(c + d*x)**2
+ 1)*tan(c + d*x)/(-4*I*b**2*d*tan(c + d*x)**2 + 8*b**2*d*tan(c + d*x) + 4*I*b**2*d) + 2*I*A*log(tan(c + d*x)*
*2 + 1)/(-4*I*b**2*d*tan(c + d*x)**2 + 8*b**2*d*tan(c + d*x) + 4*I*b**2*d) + 5*A*tan(c + d*x)/(-4*I*b**2*d*tan
(c + d*x)**2 + 8*b**2*d*tan(c + d*x) + 4*I*b**2*d) + 4*I*A/(-4*I*b**2*d*tan(c + d*x)**2 + 8*b**2*d*tan(c + d*x
) + 4*I*b**2*d) + 9*I*B*d*x*tan(c + d*x)**2/(-4*I*b**2*d*tan(c + d*x)**2 + 8*b**2*d*tan(c + d*x) + 4*I*b**2*d)
- 18*B*d*x*tan(c + d*x)/(-4*I*b**2*d*tan(c + d*x)**2 + 8*b**2*d*tan(c + d*x) + 4*I*b**2*d) - 9*I*B*d*x/(-4*I*
b**2*d*tan(c + d*x)**2 + 8*b**2*d*tan(c + d*x) + 4*I*b**2*d) - 4*B*log(tan(c + d*x)**2 + 1)*tan(c + d*x)**2/(-
4*I*b**2*d*tan(c + d*x)**2 + 8*b**2*d*tan(c + d*x) + 4*I*b**2*d) - 8*I*B*log(tan(c + d*x)**2 + 1)*tan(c + d*x)
/(-4*I*b**2*d*tan(c + d*x)**2 + 8*b**2*d*tan(c + d*x) + 4*I*b**2*d) + 4*B*log(tan(c + d*x)**2 + 1)/(-4*I*b**2*
d*tan(c + d*x)**2 + 8*b**2*d*tan(c + d*x) + 4*I*b**2*d) - 4*I*B*tan(c + d*x)**3/(-4*I*b**2*d*tan(c + d*x)**2 +
8*b**2*d*tan(c + d*x) + 4*I*b**2*d) - 19*I*B*tan(c + d*x)/(-4*I*b**2*d*tan(c + d*x)**2 + 8*b**2*d*tan(c + d*x
) + 4*I*b**2*d) + 14*B/(-4*I*b**2*d*tan(c + d*x)**2 + 8*b**2*d*tan(c + d*x) + 4*I*b**2*d), Eq(a, I*b)), (x*(A
+ B*tan(c))*tan(c)**3/(a + b*tan(c))**2, Eq(d, 0)), (2*A*a**5*b*log(a/b + tan(c + d*x))/(2*a**5*b**3*d + 2*a**
4*b**4*d*tan(c + d*x) + 4*a**3*b**5*d + 4*a**2*b**6*d*tan(c + d*x) + 2*a*b**7*d + 2*b**8*d*tan(c + d*x)) + 2*A
*a**5*b/(2*a**5*b**3*d + 2*a**4*b**4*d*tan(c + d*x) + 4*a**3*b**5*d + 4*a**2*b**6*d*tan(c + d*x) + 2*a*b**7*d
+ 2*b**8*d*tan(c + d*x)) + 2*A*a**4*b**2*log(a/b + tan(c + d*x))*tan(c + d*x)/(2*a**5*b**3*d + 2*a**4*b**4*d*t
an(c + d*x) + 4*a**3*b**5*d + 4*a**2*b**6*d*tan(c + d*x) + 2*a*b**7*d + 2*b**8*d*tan(c + d*x)) + 6*A*a**3*b**3
*log(a/b + tan(c + d*x))/(2*a**5*b**3*d + 2*a**4*b**4*d*tan(c + d*x) + 4*a**3*b**5*d + 4*a**2*b**6*d*tan(c + d
*x) + 2*a*b**7*d + 2*b**8*d*tan(c + d*x)) - A*a**3*b**3*log(tan(c + d*x)**2 + 1)/(2*a**5*b**3*d + 2*a**4*b**4*
d*tan(c + d*x) + 4*a**3*b**5*d + 4*a**2*b**6*d*tan(c + d*x) + 2*a*b**7*d + 2*b**8*d*tan(c + d*x)) + 2*A*a**3*b
**3/(2*a**5*b**3*d + 2*a**4*b**4*d*tan(c + d*x) + 4*a**3*b**5*d + 4*a**2*b**6*d*tan(c + d*x) + 2*a*b**7*d + 2*
b**8*d*tan(c + d*x)) - 4*A*a**2*b**4*d*x/(2*a**5*b**3*d + 2*a**4*b**4*d*tan(c + d*x) + 4*a**3*b**5*d + 4*a**2*
b**6*d*tan(c + d*x) + 2*a*b**7*d + 2*b**8*d*tan(c + d*x)) + 6*A*a**2*b**4*log(a/b + tan(c + d*x))*tan(c + d*x)
/(2*a**5*b**3*d + 2*a**4*b**4*d*tan(c + d*x) + 4*a**3*b**5*d + 4*a**2*b**6*d*tan(c + d*x) + 2*a*b**7*d + 2*b**
8*d*tan(c + d*x)) - A*a**2*b**4*log(tan(c + d*x)**2 + 1)*tan(c + d*x)/(2*a**5*b**3*d + 2*a**4*b**4*d*tan(c + d
*x) + 4*a**3*b**5*d + 4*a**2*b**6*d*tan(c + d*x) + 2*a*b**7*d + 2*b**8*d*tan(c + d*x)) - 4*A*a*b**5*d*x*tan(c
+ d*x)/(2*a**5*b**3*d + 2*a**4*b**4*d*tan(c + d*x) + 4*a**3*b**5*d + 4*a**2*b**6*d*tan(c + d*x) + 2*a*b**7*d +
2*b**8*d*tan(c + d*x)) + A*a*b**5*log(tan(c + d*x)**2 + 1)/(2*a**5*b**3*d + 2*a**4*b**4*d*tan(c + d*x) + 4*a*
*3*b**5*d + 4*a**2*b**6*d*tan(c + d*x) + 2*a*b**7*d + 2*b**8*d*tan(c + d*x)) + A*b**6*log(tan(c + d*x)**2 + 1)
*tan(c + d*x)/(2*a**5*b**3*d + 2*a**4*b**4*d*tan(c + d*x) + 4*a**3*b**5*d + 4*a**2*b**6*d*tan(c + d*x) + 2*a*b
**7*d + 2*b**8*d*tan(c + d*x)) - 4*B*a**6*log(a/b + tan(c + d*x))/(2*a**5*b**3*d + 2*a**4*b**4*d*tan(c + d*x)
+ 4*a**3*b**5*d + 4*a**2*b**6*d*tan(c + d*x) + 2*a*b**7*d + 2*b**8*d*tan(c + d*x)) - 4*B*a**6/(2*a**5*b**3*d +
2*a**4*b**4*d*tan(c + d*x) + 4*a**3*b**5*d + 4*a**2*b**6*d*tan(c + d*x) + 2*a*b**7*d + 2*b**8*d*tan(c + d*x))
- 4*B*a**5*b*log(a/b + tan(c + d*x))*tan(c + d*x)/(2*a**5*b**3*d + 2*a**4*b**4*d*tan(c + d*x) + 4*a**3*b**5*d
+ 4*a**2*b**6*d*tan(c + d*x) + 2*a*b**7*d + 2*b**8*d*tan(c + d*x)) - 8*B*a**4*b**2*log(a/b + tan(c + d*x))/(2
*a**5*b**3*d + 2*a**4*b**4*d*tan(c + d*x) + 4*a**3*b**5*d + 4*a**2*b**6*d*tan(c + d*x) + 2*a*b**7*d + 2*b**8*d
*tan(c + d*x)) + 2*B*a**4*b**2*tan(c + d*x)**2/(2*a**5*b**3*d + 2*a**4*b**4*d*tan(c + d*x) + 4*a**3*b**5*d + 4
*a**2*b**6*d*tan(c + d*x) + 2*a*b**7*d + 2*b**8*d*tan(c + d*x)) - 6*B*a**4*b**2/(2*a**5*b**3*d + 2*a**4*b**4*d
*tan(c + d*x) + 4*a**3*b**5*d + 4*a**2*b**6*d*tan(c + d*x) + 2*a*b**7*d + 2*b**8*d*tan(c + d*x)) + 2*B*a**3*b*
*3*d*x/(2*a**5*b**3*d + 2*a**4*b**4*d*tan(c + d*x) + 4*a**3*b**5*d + 4*a**2*b**6*d*tan(c + d*x) + 2*a*b**7*d +
2*b**8*d*tan(c + d*x)) - 8*B*a**3*b**3*log(a/b + tan(c + d*x))*tan(c + d*x)/(2*a**5*b**3*d + 2*a**4*b**4*d*ta
n(c + d*x) + 4*a**3*b**5*d + 4*a**2*b**6*d*tan(c + d*x) + 2*a*b**7*d + 2*b**8*d*tan(c + d*x)) + 2*B*a**2*b**4*
d*x*tan(c + d*x)/(2*a**5*b**3*d + 2*a**4*b**4*d*tan(c + d*x) + 4*a**3*b**5*d + 4*a**2*b**6*d*tan(c + d*x) + 2*
a*b**7*d + 2*b**8*d*tan(c + d*x)) - 2*B*a**2*b**4*log(tan(c + d*x)**2 + 1)/(2*a**5*b**3*d + 2*a**4*b**4*d*tan(
c + d*x) + 4*a**3*b**5*d + 4*a**2*b**6*d*tan(c + d*x) + 2*a*b**7*d + 2*b**8*d*tan(c + d*x)) + 4*B*a**2*b**4*ta
n(c + d*x)**2/(2*a**5*b**3*d + 2*a**4*b**4*d*tan(c + d*x) + 4*a**3*b**5*d + 4*a**2*b**6*d*tan(c + d*x) + 2*a*b
**7*d + 2*b**8*d*tan(c + d*x)) - 2*B*a**2*b**4/(2*a**5*b**3*d + 2*a**4*b**4*d*tan(c + d*x) + 4*a**3*b**5*d + 4
*a**2*b**6*d*tan(c + d*x) + 2*a*b**7*d + 2*b**8*d*tan(c + d*x)) - 2*B*a*b**5*d*x/(2*a**5*b**3*d + 2*a**4*b**4*
d*tan(c + d*x) + 4*a**3*b**5*d + 4*a**2*b**6*d*tan(c + d*x) + 2*a*b**7*d + 2*b**8*d*tan(c + d*x)) - 2*B*a*b**5
*log(tan(c + d*x)**2 + 1)*tan(c + d*x)/(2*a**5*b**3*d + 2*a**4*b**4*d*tan(c + d*x) + 4*a**3*b**5*d + 4*a**2*b*
*6*d*tan(c + d*x) + 2*a*b**7*d + 2*b**8*d*tan(c + d*x)) - 2*B*b**6*d*x*tan(c + d*x)/(2*a**5*b**3*d + 2*a**4*b*
*4*d*tan(c + d*x) + 4*a**3*b**5*d + 4*a**2*b**6*d*tan(c + d*x) + 2*a*b**7*d + 2*b**8*d*tan(c + d*x)) + 2*B*b**
6*tan(c + d*x)**2/(2*a**5*b**3*d + 2*a**4*b**4*d*tan(c + d*x) + 4*a**3*b**5*d + 4*a**2*b**6*d*tan(c + d*x) + 2
*a*b**7*d + 2*b**8*d*tan(c + d*x)), True))
________________________________________________________________________________________